package com.fpp.bytebuffer;

import java.nio.ByteBuffer;

public class ByteBufferTest {
    public static void main(String[] args) {
        ByteBuffer allocate = ByteBuffer.allocate(5);
        allocate.put((byte) 1);
        allocate.flip();
        allocate.limit(2);
        allocate.put((byte) 1);
        ByteBuffer slice = allocate.slice();
        byte b = allocate.get(0);
        System.out.println(b);
    }
}
